package msc.ai.crypto.jade;

import jade.util.leap.Serializable;

public class SalesItem implements Serializable
{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1968885364482922378L;
	
	
	private String itemName;
	private double itemPrice;
	private int itemQty;
	public SalesItem(String itemName, double itemPrice, int itemQty)
	{
		super();
		this.itemName = itemName;
		this.itemPrice = itemPrice;
		this.itemQty = itemQty;
	}
	
	public boolean sellItem(int soldQty)
	{
		boolean sellStatus = false;
		
		if (soldQty > itemQty)
		{
			sellStatus =  false;
		}
		else 
		{
			itemQty -= soldQty;
			sellStatus =  true;
		}
		
		return sellStatus;
	}

	public String getItemName()
	{
		return itemName;
	}

	public double getItemPrice()
	{
		return itemPrice;
	}

	public int getItemQty()
	{
		return itemQty;
	}
	
	
}
